<template>
	<view class="wrap">
		<view class="title">
			{{data.formwork_title || ''}}
		</view>
		<view class="cover">
			<img :src="data.image" mode="widthFix" />
			<view class="">
				封面
			</view>
		</view>
		<view class="formwork">
			<view class="item" v-for="(item,index) in data.formwork" :key="index" >
				<img :src="item.image" mode="widthFix" />
				<view class="page">
					第{{item.weigh}}页
				</view>
			</view>
			
		</view>
	</view>
		
</template>

<script>
	import http from '@/pages/request/index';
	export default {
		data() {
			return {
				data:'',
			}
		},
		onLoad(options) {
			this.id = options.id
			this.addRandomData();
		},
		methods: {
			addRandomData() {
				http('works.formwork',{id:this.id}).then(res=>{
					console.log(res);
					this.data = res.data
				})
			}
		}
	}
</script>

<style>
	/* page不能写带scope的style标签中，否则无效 */
	page {
		background-color: rgb(240, 240, 240);
	}
</style>

<style lang="scss" scoped>
	.wrap{
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #999999;
		line-height: 40rpx;
		.title {
			background-color: #fff;
			padding: 20rpx;
			text-align: center;
		}
		.cover {
			margin-top: 20rpx;
			padding: 0 95rpx;
			text-align: center;
			img {
				width: 100%;
			}
		}
		.formwork {
			padding: 20rpx 69rpx;
			display: flex;
			flex-wrap: wrap;
			.item {
				width: 50%;
				text-align: center;
				margin-bottom: 20rpx;
				img {
					width: 100%;
				}
			}
		}
	}
	
</style>